const utility = require('utility')
const mysql = require('mysql')

const connect = (param) => {
    return mysql.createConnection({
        host: '127.0.0.1',
        user: 'root',
        // password: 'zhang758521',
        password: 'zhang..123',
        database: param
    })
}

const connectPool = (param) => {
    return mysql.createPool({
        host: '127.0.0.1',
        user: 'root',
        // password: 'zhang758521',
        password: 'zhang..123',
        database: param,
        connectionLimit: 10,
    })
}

const wxParams = {
    APPID: 'wx33e9eada97c07640',
    AppSecret: 'df39305fa496ca7432577b4c00e2144a',
    jwtSecret: utility.md5(utility.md5('miniprogranm_vino_nba'))
}

module.exports = {
    connect: connect,
    connectPool: connectPool,
    wxParams: wxParams
};